home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / VALIDATE.CC < prev    next >
Text File  |  1993-04-04  |  461b  |  20 lines

  1. validate(char *goods, char val_field)
  2. {
  3. /* This function will validate a character field for valid values.
  4.  
  5.    *goods points to a character string that contains all valid character
  6.    values for the character field.
  7.  
  8.    val_field is the character to validate.
  9.  
  10.    return = 1 if val_field is valid.
  11.    return = 0 if val_fiels in not valid.
  12. */
  13.  
  14.     int x;
  15.     for(x=0;x<strlen(goods);x++) {
  16.         if(val_field==*(goods + x)) return(1);
  17.     }
  18.     return(0);
  19. }
  20.